package ru.len.cafe.ejb;

import java.util.List;

import ru.len.cafe.entity.model.CafeTable;
import ru.len.cafe.entity.model.Dish;
import ru.len.cafe.entity.model.Employe;
import ru.len.cafe.entity.model.Serve;

/**
 * Bean that represents functionality for waiter.
 * 
 * @author Chetvertkov_Stanislav
 */

public interface WaiterEJBLocal {
    /*
     * Canceling Serve Reason constants
     */
    public static final int CLIENT_LEFT=1;
    public static final int ORDER_FAIL=1;
    
    /**
     * Method authorizes waiter in system
     * @param login
     * @param password
     * @return
     */
    Employe authorize(String login, String password);

    /**
     * Creates new Serve at current table
     * @param table
     * @return
     */
    Serve createServe(CafeTable table);
    
    /**
     * Adds dishes to existing Serve
     * @param serve. existing Serve.
     * @param dishes. Dishes to add.
     * @return 
     */
    boolean addDishesToServe(Serve serve, List<Dish> dishes);
    
    /**
     * Moves existing Serve to other free table at the cafe.
     * @param serve. Existing Serve.
     * @param table. Where Serve should to be moved.
     * @return
     */
    boolean moveServeToTable(Serve serve, CafeTable table);
    
    /**
     * Cancels Serve.
     * @param serve
     * @param reason. Reason to cancel existing Serve.
     */
    void cancelServe(Serve serve, int reason);
    /**
     * 
     * @param serve
     */
    Check getCheck(Serve serve);
    
    /**
     * 
     * @param serve
     * @return
     */
    PayCheck closeServe(Serve serve);
    
    /**
     * Executes, when waiter exits the system
     */
    void logOut();
}
